<template>
  <div ref="print" v-show="isPreview">
    <div class="print-wrap-body" style="width:99%; margin: 10px auto 0;">
      <table style="border-collapse: collapse" width="100%">
        <tbody>
          <tr height="100px">
            <td rowspan="1" colspan="6" valign="center" style="font-weight: 700; font-size: 30px; text-align: center; width: 100%;">旧件出库单</td>
          </tr>
          <tr height="40px">
            <td rowspan="1" colspan="3" valign="center" style="font-weight: 400; font-size: 14px; text-align: left; width: 51%; border-bottom: solid #000000 1px">收货单位：{{list1.supName}}</td>
            <td rowspan="1" colspan="2" valign="center" style="font-weight: 400; font-size: 14px; text-align: left; width: 19%; border-bottom: solid #000000 1px">日期：{{nowTime}}</td>
            <td rowspan="1" colspan="1" valign="center" style="font-weight: 400; font-size: 14px; text-align: left; width: 30%; border-bottom: solid #000000 1px">编号：{{list1.outNo}}</td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; width: 8%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">序号</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; width: 20%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">旧件代码</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; width: 23%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">旧件名称</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; width: 9%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">单位</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; width: 8%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">数量</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; width: 30%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">备注</td>
          </tr>
          <tr height="25px" v-for="(item,index) in list" :key="index">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{index+1}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.partCode}}</td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.partName}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.partUnti}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: center; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.outCount}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{list1.outRemarks}}</td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px" >
            <td rowspan="2" colspan="1" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;">制单人：</td>
            <td rowspan="2" colspan="1" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;">{{data.createdByName}}</td>

            <td rowspan="2" colspan="1" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;">旧件专员：</td>

            <td rowspan="2" colspan="3" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;">收货人：</td>

          </tr>
          <tr height="25px"></tr>
        </tbody>
      </table>
    </div>
  </div>
</template>

<script>
import moment from 'moment';
export default {
  name: 'templateWaitReturnLabelList',
  props: {
    //传值 从上一页
    data: {
      type: Object,
      required: true,
      default() {
        return {};
      }
    },
    isPreview: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      nowTime: moment().format('YYYY-MM-DD'),
      list: [],
      list1:{},
    };
  },
  computed: {},
  created() { },
  mounted() {
    this.list = this.data.rows.dtlList;
    this.list1 = this.data.rows
    this.$nextTick(function () {
      //必须写
      console.log('this.list 渲染数据 =>', this.list,this.list1, this.data);
      this.$emit('onPrintTable', this.$refs.print.innerHTML);
    });
    if (this.isPreview) {
      this.fillInToDom();
    }
  },
  methods: {
    fillInToDom() {
      this.isPreview = true;
    },


  }
};
</script>

<style>
</style>
